
(function(window,document,Laya){
	var __un=Laya.un,__uns=Laya.uns,__static=Laya.static,__class=Laya.class,__getset=Laya.getset,__newvec=Laya.__newvec;

	var Box=laya.ui.Box,CheckBox=laya.ui.CheckBox,ColorPickerInput=laya.ide.props.ColorPickerInput,ComboBox=laya.ui.ComboBox;
	var DragNumberInput=laya.ide.props.DragNumberInput,Event=laya.events.Event,FileManager=laya.ide.managers.FileManager;
	var HSlider=laya.ui.HSlider,IDEEvent=laya.ide.event.IDEEvent,Image=laya.ui.Image,Label=laya.ui.Label,Notice=ide.managers.Notice;
	var PropsInputBase=laya.ide.props.PropsInputBase,ResFileManager=laya.ide.managers.ResFileManager,Sprite=laya.display.Sprite;
	var StyleConsts=laya.ide.config.StyleConsts,TextInput=laya.ui.TextInput;
//class laya.ide.props.LayaBlinnPhongMaterialUI extends laya.ide.props.PropsInputBase
var LayaBlinnPhongMaterialUI=(function(_super){
	function LayaBlinnPhongMaterialUI(){
		this.sizeGrid="5,15,5,5";
		this.renderModeLabel=null;
		this.renderMode=null;
		this.lightingLabel=null;
		this.lighting=null;
		this.primaryLabel=null;
		this.albedoLabel=null;
		this.albedoTexture=null;
		this.albedoColor=null;
		this.intensityLabel=null;
		this.intensity=null;
		this.specularLabel=null;
		this.specularTexture=null;
		this.specularColor=null;
		this.shininessLabel=null;
		this.shininess=null;
		this.normalLabel=null;
		this.normalTexture=null;
		this.tilingOffsetLabel=null;
		this.tilingOffsetLabel1=null;
		this.tilingOffsetLabel2=null;
		this.tilingOffsetLabel3=null;
		this.tilingOffsetLabel4=null;
		this.tilingOffset1=null;
		this.tilingOffset2=null;
		this.tilingOffset3=null;
		this.tilingOffset4=null;
		this.advancedLabel=null;
		this.alphaTestLabel=null;
		this.alphaTest=null;
		this.alphaTestValue=null;
		this.alphaBlendLabel=null;
		this.alphaBlend=null;
		this.srcBlend=null;
		this.dstBlend=null;
		this.depthWriteLabel=null;
		this.depthWrite=null;
		this.depthTestLabel=null;
		this.depthTest=null;
		this.cullLabel=null;
		this.cull=null;
		this.renderQueueLabel=null;
		this.renderQueueBox=null;
		this.renderQueue=null;
		this.lmatPath=null;
		this.lmatObject=null;
		this.lmatProps=null;
		var _$this=this;
		LayaBlinnPhongMaterialUI.__super.call(this);
		this.height=550;
		this.width=400;
		this.useIDELabel=false;
		this.renderModeLabel=new Label();
		this.renderModeLabel.text="RenderMode";
		this.renderModeLabel.color=StyleConsts.TreeItemColor;
		this.renderModeLabel.pos(0,6);
		this.addChild(this.renderModeLabel);
		this.renderMode=new ComboBox("comp/combo_22.png","Opaque,Cutout,Transparent,Addtive,Custom");
		this.renderMode.left=90;
		this.renderMode.right=0;
		this.renderMode.sizeGrid=this.sizeGrid;
		this.renderMode.height=24;
		this.renderMode.pos(90,0);
		this.renderMode.on("change",this,function(){
			_$this.lmatProps.renderMode=_$this.renderMode.selectedIndex;
			FileManager.createJSONFile(_$this.lmatPath,_$this.lmatObject);
		});
		this.addChild(this.renderMode);
		this.lightingLabel=new Label();
		this.lightingLabel.text="Lighting";
		this.lightingLabel.color=StyleConsts.TreeItemColor;
		this.lightingLabel.pos(0,33);
		this.addChild(this.lightingLabel);
		this.lighting=new ComboBox("comp/combo_22.png","ON,OFF");
		this.lighting.left=90;
		this.lighting.right=0;
		this.lighting.sizeGrid=this.sizeGrid;
		this.lighting.height=24;
		this.lighting.pos(90,27);
		this.lighting.on("change",this,function(){
			if (_$this.lighting.selectedIndex==0){
				_$this.lmatProps.enableLighting=true;
			}
			else{
				_$this.lmatProps.enableLighting=false;
			}
			FileManager.createJSONFile(_$this.lmatPath,_$this.lmatObject);
		});
		this.addChild(this.lighting);
		this.primaryLabel=new Label();
		this.primaryLabel.text="Primary Properties";
		this.primaryLabel.italic=true;
		this.primaryLabel.color=StyleConsts.TreeItemColor;
		this.primaryLabel.pos(0,60);
		this.addChild(this.primaryLabel);
		this.albedoLabel=new Label();
		this.albedoLabel.text="Albedo";
		this.albedoLabel.color=StyleConsts.TreeItemColor;
		this.albedoLabel.pos(10,98);
		this.addChild(this.albedoLabel);
		this.albedoTexture=new Image("comp/image.png");
		this.albedoTexture.width=30;
		this.albedoTexture.height=30;
		this.albedoTexture.pos(80,85);
		this.albedoTexture.mouseEnabled=true;
		this.albedoTexture.on("dragDrop",this,this.onDragDrop,["albedoTexture"]);
		this.albedoTexture.on("mousedown",this,this.onMouseDown,["albedoTexture"]);
		this.addChild(this.albedoTexture);
		this.albedoColor=new ColorPickerInput();
		this.albedoColor.width=225;
		this.albedoColor.height=25;
		this.albedoColor.pos(150,88);
		this.albedoColor.setColorArr([1,1,1,1]);
		this.albedoColor.on("ColorChanged",this,this.onChangeColor,["albedoColor"]);
		this.albedoColor.on("COLOR_CHANGING",this,this.onChangeColor,["albedoColor"]);
		this.addChild(this.albedoColor);
		this.intensityLabel=new Label();
		this.intensityLabel.text="Intensity";
		this.intensityLabel.color=StyleConsts.TreeItemColor;
		this.intensityLabel.pos(75,125);
		this.addChild(this.intensityLabel);
		this.intensity=new HSlider();
		this.intensity.skin="comp/hslider.png";
		this.intensity.left=150;
		this.intensity.right=20;
		this.intensity.min=1;
		this.intensity.max=8;
		this.intensity.tick=0.01;
		this.intensity.pos(150,128);
		this.intensity.on("change",this,function(){
			_$this.lmatProps.albedoIntensity=_$this.intensity.value;
			FileManager.createJSONFile(_$this.lmatPath,_$this.lmatObject);
		});
		this.addChild(this.intensity);
		this.specularLabel=new Label();
		this.specularLabel.text="specular";
		this.specularLabel.color=StyleConsts.TreeItemColor;
		this.specularLabel.pos(10,163);
		this.addChild(this.specularLabel);
		this.specularTexture=new Image("comp/image.png");
		this.specularTexture.width=30;
		this.specularTexture.height=30;
		this.specularTexture.pos(80,150);
		this.specularTexture.mouseEnabled=true;
		this.specularTexture.on("dragDrop",this,this.onDragDrop,["specularTexture"]);
		this.specularTexture.on("mousedown",this,this.onMouseDown,["specularTexture"]);
		this.addChild(this.specularTexture);
		this.specularColor=new ColorPickerInput();
		this.specularColor.width=225;
		this.specularColor.height=25;
		this.specularColor.pos(150,153);
		this.specularColor.setColorArr([0.5,0.5,0.5,1]);
		this.specularColor.on("ColorChanged",this,this.onChangeColor,["specularColor"]);
		this.specularColor.on("COLOR_CHANGING",this,this.onChangeColor,["specularColor"]);
		this.addChild(this.specularColor);
		this.shininessLabel=new Label();
		this.shininessLabel.text="shininess";
		this.shininessLabel.color=StyleConsts.TreeItemColor;
		this.shininessLabel.pos(75,190);
		this.addChild(this.shininessLabel);
		this.shininess=new HSlider();
		this.shininess.skin="comp/hslider.png";
		this.shininess.left=150;
		this.shininess.right=20;
		this.shininess.min=0.01;
		this.shininess.max=1;
		this.shininess.tick=0.01;
		this.shininess.pos(150,193);
		this.shininess.on("change",this,function(){
			_$this.lmatProps.shininess=_$this.shininess.value;
			FileManager.createJSONFile(_$this.lmatPath,_$this.lmatObject);
		});
		this.addChild(this.shininess);
		this.normalLabel=new Label();
		this.normalLabel.text="normal";
		this.normalLabel.color=StyleConsts.TreeItemColor;
		this.normalLabel.pos(10,228);
		this.addChild(this.normalLabel);
		this.normalTexture=new Image("comp/image.png");
		this.normalTexture.width=30;
		this.normalTexture.height=30;
		this.normalTexture.pos(80,215);
		this.normalTexture.mouseEnabled=true;
		this.normalTexture.on("dragDrop",this,this.onDragDrop,["normalTexture"]);
		this.normalTexture.on("mousedown",this,this.onMouseDown,["normalTexture"]);
		this.addChild(this.normalTexture);
		this.tilingOffsetLabel=new Label();
		this.tilingOffsetLabel.text="tilingOffset";
		this.tilingOffsetLabel.color=StyleConsts.TreeItemColor;
		this.tilingOffsetLabel.pos(10,270);
		this.addChild(this.tilingOffsetLabel);
		this.tilingOffsetLabel1=new Label();
		this.tilingOffsetLabel1.width=10;
		this.tilingOffsetLabel1.height=20;
		this.tilingOffsetLabel1.pos(70,255);
		this.addChild(this.tilingOffsetLabel1);
		this.tilingOffsetLabel2=new Label();
		this.tilingOffsetLabel2.width=10;
		this.tilingOffsetLabel2.height=20;
		this.tilingOffsetLabel2.pos(180,255);
		this.addChild(this.tilingOffsetLabel2);
		this.tilingOffsetLabel3=new Label();
		this.tilingOffsetLabel3.width=10;
		this.tilingOffsetLabel3.height=20;
		this.tilingOffsetLabel3.pos(70,280);
		this.addChild(this.tilingOffsetLabel3);
		this.tilingOffsetLabel4=new Label();
		this.tilingOffsetLabel4.width=10;
		this.tilingOffsetLabel4.height=20;
		this.tilingOffsetLabel4.pos(180,280);
		this.addChild(this.tilingOffsetLabel4);
		this.tilingOffset1=new DragNumberInput();
		this.tilingOffset1.width=100;
		this.tilingOffset1.height=20;
		this.tilingOffset1.pos(80,255);
		this.tilingOffset1.skin="comp/input_22.png";
		this.tilingOffset1.initByConfig({"minChange":0.01});
		this.tilingOffset1.setControlObject(this.tilingOffsetLabel1);
		this.tilingOffset1.on("enter",this,this.changeTilingOffset,[0]);
		this.tilingOffset1.on("blur",this,this.changeTilingOffset,[0]);
		this.addChild(this.tilingOffset1);
		this.tilingOffset2=new DragNumberInput();
		this.tilingOffset2.width=100;
		this.tilingOffset2.height=20;
		this.tilingOffset2.pos(190,255);
		this.tilingOffset2.skin="comp/input_22.png";
		this.tilingOffset2.initByConfig({"minChange":0.01});
		this.tilingOffset2.setControlObject(this.tilingOffsetLabel2);
		this.tilingOffset2.on("enter",this,this.changeTilingOffset,[1]);
		this.tilingOffset2.on("blur",this,this.changeTilingOffset,[1]);
		this.addChild(this.tilingOffset2);
		this.tilingOffset3=new DragNumberInput();
		this.tilingOffset3.width=100;
		this.tilingOffset3.height=20;
		this.tilingOffset3.pos(80,280);
		this.tilingOffset3.skin="comp/input_22.png";
		this.tilingOffset3.initByConfig({"minChange":0.01});
		this.tilingOffset3.setControlObject(this.tilingOffsetLabel3);
		this.tilingOffset3.on("enter",this,this.changeTilingOffset,[2]);
		this.tilingOffset3.on("blur",this,this.changeTilingOffset,[2]);
		this.addChild(this.tilingOffset3);
		this.tilingOffset4=new DragNumberInput();
		this.tilingOffset4.width=100;
		this.tilingOffset4.height=20;
		this.tilingOffset4.pos(190,280);
		this.tilingOffset4.skin="comp/input_22.png";
		this.tilingOffset4.initByConfig({"minChange":0.01});
		this.tilingOffset4.setControlObject(this.tilingOffsetLabel4);
		this.tilingOffset4.on("enter",this,this.changeTilingOffset,[3]);
		this.tilingOffset4.on("blur",this,this.changeTilingOffset,[3]);
		this.addChild(this.tilingOffset4);
		this.advancedLabel=new Label();
		this.advancedLabel.text="Advanced Properties";
		this.advancedLabel.italic=true;
		this.advancedLabel.color=StyleConsts.TreeItemColor;
		this.advancedLabel.pos(0,310);
		this.addChild(this.advancedLabel);
		this.alphaTestLabel=new Label();
		this.alphaTestLabel.text="AlphaTest";
		this.alphaTestLabel.color=StyleConsts.TreeItemColor;
		this.alphaTestLabel.pos(10,335);
		this.addChild(this.alphaTestLabel);
		this.alphaTest=new CheckBox("comp/checkbox.png");
		this.alphaTest.pos(100,335);
		this.alphaTest.on("change",this,function(){
			_$this.lmatProps.alphaTest=_$this.alphaTest.selected;
			FileManager.createJSONFile(_$this.lmatPath,_$this.lmatObject);
		});
		this.addChild(this.alphaTest);
		this.alphaTestValue=new HSlider();
		this.alphaTestValue.skin="comp/hslider.png";
		this.alphaTestValue.left=150;
		this.alphaTestValue.right=20;
		this.alphaTestValue.min=0;
		this.alphaTestValue.max=1;
		this.alphaTestValue.tick=0.01;
		this.alphaTestValue.pos(150,340);
		this.alphaTestValue.on("change",this,function(){
			_$this.lmatProps.alphaTestValue=_$this.alphaTestValue.value;
			FileManager.createJSONFile(_$this.lmatPath,_$this.lmatObject);
		});
		this.addChild(this.alphaTestValue);
		this.alphaBlendLabel=new Label();
		this.alphaBlendLabel.text="AlphaBlend";
		this.alphaBlendLabel.color=StyleConsts.TreeItemColor;
		this.alphaBlendLabel.pos(10,360);
		this.addChild(this.alphaBlendLabel);
		this.alphaBlend=new CheckBox("comp/checkbox.png");
		this.alphaBlend.pos(100,360);
		this.alphaBlend.on("change",this,function(){
			if (_$this.alphaBlend.selected){
				_$this.lmatProps.blend=1;
				}else {
				_$this.lmatProps.blend=0;
			}
			FileManager.createJSONFile(_$this.lmatPath,_$this.lmatObject);
		});
		this.addChild(this.alphaBlend);
		this.srcBlend=new ComboBox("comp/combo_22.png","Zero,One,DstColor,SrcColor,OneMinusDstColor,SrcAlpha,OneMinusSrcColor,DstAlpha,OneMinusDstAlpha,SrcAlphaSaturate,OneMinusSrcAlpha");
		this.srcBlend.scrollBarSkin="comp/vscroll.png";
		this.srcBlend.sizeGrid=this.sizeGrid;
		this.srcBlend.width=150;
		this.srcBlend.height=24;
		this.srcBlend.pos(90,380);
		this.srcBlend.on("change",this,function(){
			switch (_$this.srcBlend.selectedIndex){
				case 0:
					_$this.lmatProps.srcBlend=0;
					break ;
				case 1:
					_$this.lmatProps.srcBlend=1;
					break ;
				case 2:
					_$this.lmatProps.srcBlend=774;
					break ;
				case 3:
					_$this.lmatProps.srcBlend=768;
					break ;
				case 4:
					_$this.lmatProps.srcBlend=775;
					break ;
				case 5:
					_$this.lmatProps.srcBlend=770;
					break ;
				case 6:
					_$this.lmatProps.srcBlend=769;
					break ;
				case 7:
					_$this.lmatProps.srcBlend=772;
					break ;
				case 8:
					_$this.lmatProps.srcBlend=773;
					break ;
				case 9:
					_$this.lmatProps.srcBlend=776;
					break ;
				case 10:
					_$this.lmatProps.srcBlend=771;
					break ;
				default :
					_$this.lmatProps.srcBlend=1;
					break ;
				}
			FileManager.createJSONFile(_$this.lmatPath,_$this.lmatObject);
		});
		this.addChild(this.srcBlend);
		this.dstBlend=new ComboBox("comp/combo_22.png","Zero,One,DstColor,SrcColor,OneMinusDstColor,SrcAlpha,OneMinusSrcColor,DstAlpha,OneMinusDstAlpha,SrcAlphaSaturate,OneMinusSrcAlpha");
		this.dstBlend.scrollBarSkin="comp/vscroll.png";
		this.dstBlend.sizeGrid=this.sizeGrid;
		this.dstBlend.width=150;
		this.dstBlend.height=24;
		this.dstBlend.pos(250,380);
		this.dstBlend.on("change",this,function(){
			switch (_$this.dstBlend.selectedIndex){
				case 0:
					_$this.lmatProps.dstBlend=0;
					break ;
				case 1:
					_$this.lmatProps.dstBlend=1;
					break ;
				case 2:
					_$this.lmatProps.dstBlend=774;
					break ;
				case 3:
					_$this.lmatProps.dstBlend=768;
					break ;
				case 4:
					_$this.lmatProps.dstBlend=775;
					break ;
				case 5:
					_$this.lmatProps.dstBlend=770;
					break ;
				case 6:
					_$this.lmatProps.dstBlend=769;
					break ;
				case 7:
					_$this.lmatProps.dstBlend=772;
					break ;
				case 8:
					_$this.lmatProps.dstBlend=773;
					break ;
				case 9:
					_$this.lmatProps.dstBlend=776;
					break ;
				case 10:
					_$this.lmatProps.dstBlend=771;
					break ;
				default :
					_$this.lmatProps.dstBlend=1;
					break ;
				}
			FileManager.createJSONFile(_$this.lmatPath,_$this.lmatObject);
		});
		this.addChild(this.dstBlend);
		this.depthWriteLabel=new Label();
		this.depthWriteLabel.text="DepthWrite";
		this.depthWriteLabel.color=StyleConsts.TreeItemColor;
		this.depthWriteLabel.pos(10,410);
		this.addChild(this.depthWriteLabel);
		this.depthWrite=new CheckBox("comp/checkbox.png");
		this.depthWrite.pos(100,410);
		this.depthWrite.on("change",this,function(){
			_$this.lmatProps.depthWrite=_$this.depthWrite.selected;
			FileManager.createJSONFile(_$this.lmatPath,_$this.lmatObject);
		});
		this.addChild(this.depthWrite);
		this.depthTestLabel=new Label();
		this.depthTestLabel.text="DepthTest";
		this.depthTestLabel.color=StyleConsts.TreeItemColor;
		this.depthTestLabel.pos(10,440);
		this.addChild(this.depthTestLabel);
		this.depthTest=new ComboBox("comp/combo_22.png","OFF,Never,LESS,EQUAL,LEQUAL,GREATER,NOTEQUAL,GEQUAL,ALWAYS");
		this.depthTest.scrollBarSkin="comp/vscroll.png";
		this.depthTest.left=90;
		this.depthTest.right=0;
		this.depthTest.sizeGrid=this.sizeGrid;
		this.depthTest.height=24;
		this.depthTest.pos(90,435);
		this.depthTest.on("change",this,function(){
			switch (_$this.depthTest.selectedIndex){
				case 0:
					_$this.lmatProps.depthTest=0;
					break ;
				case 1:
					_$this.lmatProps.depthTest=512;
					break ;
				case 2:
					_$this.lmatProps.depthTest=513;
					break ;
				case 3:
					_$this.lmatProps.depthTest=514;
					break ;
				case 4:
					_$this.lmatProps.depthTest=515;
					break ;
				case 5:
					_$this.lmatProps.depthTest=516;
					break ;
				case 6:
					_$this.lmatProps.depthTest=517;
					break ;
				case 7:
					_$this.lmatProps.depthTest=518;
					break ;
				case 8:
					_$this.lmatProps.depthTest=519;
					break ;
				default :
					_$this.lmatProps.depthTest=0;
					break ;
				}
			FileManager.createJSONFile(_$this.lmatPath,_$this.lmatObject);
		});
		this.addChild(this.depthTest);
		this.cullLabel=new Label();
		this.cullLabel.text="Cull";
		this.cullLabel.color=StyleConsts.TreeItemColor;
		this.cullLabel.pos(10,470);
		this.addChild(this.cullLabel);
		this.cull=new ComboBox("comp/combo_22.png","CULL_NONE,CULL_FRONT,CULL_BACK");
		this.cull.left=90;
		this.cull.right=0;
		this.cull.sizeGrid=this.sizeGrid;
		this.cull.height=24;
		this.cull.pos(90,465);
		this.cull.on("change",this,function(){
			_$this.lmatProps.cull=_$this.cull.selectedIndex;
			FileManager.createJSONFile(_$this.lmatPath,_$this.lmatObject);
		});
		this.addChild(this.cull);
		this.renderQueueLabel=new Label();
		this.renderQueueLabel.text="RenderQueue";
		this.renderQueueLabel.color=StyleConsts.TreeItemColor;
		this.renderQueueLabel.pos(10,500);
		this.addChild(this.renderQueueLabel);
		this.renderQueueBox=new ComboBox("comp/combo_22.png","Geometry,AlphaTest,Transparent");
		this.renderQueueBox.width=150;
		this.renderQueueBox.height=24;
		this.renderQueueBox.sizeGrid=this.sizeGrid;
		this.renderQueueBox.pos(90,495);
		this.renderQueueBox.on("change",this,function(){
			_$this.lmatProps.renderQueueMode=_$this.renderQueueBox.selectedIndex;
			FileManager.createJSONFile(_$this.lmatPath,_$this.lmatObject);
		});
		this.addChild(this.renderQueueBox);
		this.renderQueue=new TextInput();
		this.renderQueue.skin="comp/input_22.png";
		this.renderQueue.width=100;
		this.renderQueue.height=24;
		this.renderQueue.sizeGrid=this.sizeGrid;
		this.renderQueue.pos(250,495);
		this.renderQueue.color=StyleConsts.TreeItemColor;
		this.renderQueue.on("enter",this,function(){
			_$this.lmatProps.renderQueue=_$this.renderQueue.text;
			FileManager.createJSONFile(_$this.lmatPath,_$this.lmatObject);
		});
		this.renderQueue.on("blur",this,function(){
			_$this.lmatProps.renderQueue=_$this.renderQueue.text;
			FileManager.createJSONFile(_$this.lmatPath,_$this.lmatObject);
		});
		this.addChild(this.renderQueue);
	}

	__class(LayaBlinnPhongMaterialUI,'laya.ide.props.LayaBlinnPhongMaterialUI',_super);
	var __proto=LayaBlinnPhongMaterialUI.prototype;
	__proto.changeTilingOffset=function(index,e){
		var vectors=this.lmatProps.vectors;
		var vector;
		for (var j=0;j < vectors.length;j++){
			vector=vectors[j];
			if (vector.name=="tilingOffset"){
				switch (index){
					case 0:
						vector.value[0]=parseFloat(this.tilingOffset1.text);
						break ;
					case 1:
						vector.value[1]=parseFloat(this.tilingOffset2.text);
						break ;
					case 2:
						vector.value[2]=parseFloat(this.tilingOffset3.text);
						break ;
					case 3:
						vector.value[3]=parseFloat(this.tilingOffset4.text);
						break ;
					}
			}
		}
		FileManager.createJSONFile(this.lmatPath,this.lmatObject);
	}

	__proto.onChangeColor=function(type,e){
		var vectors=this.lmatProps.vectors;
		var vector;
		var sendColor;
		for (var j=0;j < vectors.length;j++){
			vector=vectors[j];
			if (vector.name=="albedoColor"){
				if (type=="albedoColor"){
					sendColor=vector.value=this.albedoColor.getColorArr();
				}
			}
			else if (vector.name=="specularColor"){
				if (type=="specularColor"){
					sendColor=vector.value=this.specularColor.getColorArr();
				}
			}
		}
		Notice.notify("Change_Material",[e.target.compId ,type,sendColor]);
		FileManager.createJSONFile(this.lmatPath,this.lmatObject);
	}

	__proto.onDragDrop=function(type,e){
		var path=e._data.asset;
		var texturePath=path.replace('\\','/');
		if (type=="albedoTexture"){
			this.albedoTexture.skin=texturePath;
			}else if (type=="specularTexture"){
			this.specularTexture.skin=texturePath;
			}else if (type=="normalTexture"){
			this.normalTexture.skin=texturePath;
		};
		var findTexture=false;
		var textures=this.lmatProps.textures;
		var texture;
		for (var i=0;i < textures.length;i++){
			texture=textures[i];
			if (texture.name==type){
				texture.path=FileManager.getRelativePath(this.lmatPath.substring(0,this.lmatPath.lastIndexOf('/')),path);
				findTexture=true;
			}
		}
		if (!findTexture){
			texture=new Object();
			texture.name=type;
			texture.path=FileManager.getRelativePath(this.lmatPath.substring(0,this.lmatPath.lastIndexOf('/')),path);
			textures.push(texture);
		}
		FileManager.createJSONFile(this.lmatPath,this.lmatObject);
	}

	__proto.onMouseDown=function(type,e){
		var path;
		if (type=="albedoTexture"){
			path=this.albedoTexture.skin;
			}else if (type=="specularTexture"){
			path=this.specularTexture.skin;
			}else if (type=="normalTexture"){
			path=this.normalTexture.skin;
		}
		path=path.replace('\\','/');
		Notice.notify("SELECT_Project_FILE",[path]);
	}

	__proto.setTarget=function(target){
		_super.prototype.setTarget.call(this,target);
		this.lmatPath=ResFileManager.getIDEResPath(target.props.material);
		if (FileManager.exists(this.lmatPath)){
			this.lmatObject=FileManager.readJSONFile(this.lmatPath);
			this.lmatProps=this.lmatObject.props;
			this.renderMode.selectedIndex=this.lmatProps.renderMode;
			if (this.lmatProps.enableLighting){
				this.lighting.selectedIndex=0;
				}else {
				this.lighting.selectedIndex=1;
			}
			this.intensity.value=this.lmatProps.albedoIntensity;
			this.shininess.value=this.lmatProps.shininess;
			var textures=this.lmatProps.textures;
			var texture;
			for (var i=0;i < textures.length;i++){
				texture=textures[i];
				if (texture.name=="albedoTexture"){
					var albedoTexturePath=FileManager.getPath(this.lmatPath.substring(0,this.lmatPath.lastIndexOf('/')),texture.path);
					this.albedoTexture.skin=albedoTexturePath;
					}else if (texture.name=="specularTexture"){
					var specularTexturePath=FileManager.getPath(this.lmatPath.substring(0,this.lmatPath.lastIndexOf('/')),texture.path);
					this.specularTexture.skin=specularTexturePath;
					}else if (texture.name=="normalTexture"){
					var normalTexturePath=FileManager.getPath(this.lmatPath.substring(0,this.lmatPath.lastIndexOf('/')),texture.path);
					this.normalTexture.skin=normalTexturePath;
				}
			};
			var vectors=this.lmatProps.vectors;
			var vector;
			for (var j=0;j < vectors.length;j++){
				vector=vectors[j];
				if (vector.name=="albedoColor"){
					this.albedoColor.setColorArr(vector.value);
					this.albedoColor.setTarget(target);
					}else if (vector.name=="specularColor"){
					this.specularColor.setColorArr(vector.value);
					this.specularColor.setTarget(target);
					}else if (vector.name=="tilingOffset"){
					this.tilingOffset1.text=vector.value[0].toString();
					this.tilingOffset2.text=vector.value[1].toString();
					this.tilingOffset3.text=vector.value[2].toString();
					this.tilingOffset4.text=vector.value[3].toString();
				}
			}
			this.alphaTest.selected=this.lmatProps.alphaTest;
			this.alphaTestValue.value=this.lmatProps.alphaTestValue;
			this.alphaBlend.selected=this.lmatProps.blend;
			switch (this.lmatProps.srcBlend){
				case 0:
					this.srcBlend.selectedIndex=0;
					break ;
				case 1:
					this.srcBlend.selectedIndex=1;
					break ;
				case 774:
					this.srcBlend.selectedIndex=2;
					break ;
				case 768:
					this.srcBlend.selectedIndex=3;
					break ;
				case 775:
					this.srcBlend.selectedIndex=4;
					break ;
				case 770:
					this.srcBlend.selectedIndex=5;
					break ;
				case 769:
					this.srcBlend.selectedIndex=6;
					break ;
				case 772:
					this.srcBlend.selectedIndex=7;
					break ;
				case 773:
					this.srcBlend.selectedIndex=8;
					break ;
				case 776:
					this.srcBlend.selectedIndex=9;
					break ;
				case 771:
					this.srcBlend.selectedIndex=10;
					break ;
				default :
					this.srcBlend.selectedIndex=1;
					break ;
				}
			switch (this.lmatProps.dstBlend){
				case 0:
					this.dstBlend.selectedIndex=0;
					break ;
				case 1:
					this.dstBlend.selectedIndex=1;
					break ;
				case 774:
					this.dstBlend.selectedIndex=2;
					break ;
				case 768:
					this.dstBlend.selectedIndex=3;
					break ;
				case 775:
					this.dstBlend.selectedIndex=4;
					break ;
				case 770:
					this.dstBlend.selectedIndex=5;
					break ;
				case 769:
					this.dstBlend.selectedIndex=6;
					break ;
				case 772:
					this.dstBlend.selectedIndex=7;
					break ;
				case 773:
					this.dstBlend.selectedIndex=8;
					break ;
				case 776:
					this.dstBlend.selectedIndex=9;
					break ;
				case 771:
					this.dstBlend.selectedIndex=10;
					break ;
				default :
					this.srcBlend.selectedIndex=0;
					break ;
				}
			this.depthWrite.selected=this.lmatProps.depthWrite;
			switch (this.lmatProps.depthTest){
				case 0:
					this.depthTest.selectedIndex=0;
					break ;
				case 512:
					this.depthTest.selectedIndex=1;
					break ;
				case 513:
					this.depthTest.selectedIndex=2;
					break ;
				case 514:
					this.depthTest.selectedIndex=3;
					break ;
				case 515:
					this.depthTest.selectedIndex=4;
					break ;
				case 516:
					this.depthTest.selectedIndex=5;
					break ;
				case 517:
					this.depthTest.selectedIndex=6;
					break ;
				case 518:
					this.depthTest.selectedIndex=7;
					break ;
				case 519:
					this.depthTest.selectedIndex=8;
					break ;
				default :
					this.depthTest.selectedIndex=0;
					break ;
				}
			this.cull.selectedIndex=this.lmatProps.cull;
			this.renderQueueBox.selectedIndex=this.lmatProps.renderQueueMode;
			this.renderQueue.text=this.lmatProps.renderQueue;
		}
	}

	__proto.initByConfig=function(configO){
		_super.prototype.initByConfig.call(this,configO);
	}

	LayaBlinnPhongMaterialUI.__init$=function(){
		PropsInputBase.regPlugin("BlinnPhongMaterial",LayaBlinnPhongMaterialUI);;
	}

	return LayaBlinnPhongMaterialUI;
})(PropsInputBase)


	Laya.__init([LayaBlinnPhongMaterialUI]);
})(window,document,Laya);

if (typeof define === 'function' && define.amd){
	define('laya.core', ['require', "exports"], function(require, exports) {
        'use strict';
        Object.defineProperty(exports, '__esModule', { value: true });
        for (var i in Laya) {
			var o = Laya[i];
            o && o.__isclass && (exports[i] = o);
        }
    });
}